package com.jiangjiang.eshop.wms.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiangjiang.eshop.wms.dao.WmsGoodsAllocationStockMapper;
import com.jiangjiang.eshop.wms.domain.WmsGoodsAllocationStock;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

/**
 * @ClassName GoodsAllocationStockService
 * @Description TODO
 * @Author jhw
 * @Date 2021/9/14 19:57
 * @Version 1.0
 **/
@Service
public class WmsGoodsAllocationStockService extends ServiceImpl<WmsGoodsAllocationStockMapper, WmsGoodsAllocationStock> {

    /**
     * 根据sku id 查询所有的货位库存数据
     * @param goodsSkuId 商品sku id
     * @return 查询结果
     */
    public List<WmsGoodsAllocationStock> queryBySkuId(Long goodsSkuId) {
        LambdaQueryWrapper<WmsGoodsAllocationStock> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(WmsGoodsAllocationStock::getGoodsSkuId, goodsSkuId);
        return this.list(wrapper);
    }

}
